home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Brotikasten
/
BROTCD01.iso
/
lern
/
lern451.d64
/
program lister
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
1995-08-09
|
3KB
|
105 lines
5 POKE53281,1
10 PRINT"[152][147] UNIVERSAL LISTER":PRINT""
15 PRINT" COMMODORE 64":FORT=1TO2000:NEXTT
16 REM COMPUTE DEC 82
100 DATA19,147,17,145,29,157,18,146,20,148,141,32
110 REM80-COLUMN CURSOR STUFF
120 DATA7,21,149,22,150,14,142,25,153
130 DATA15,143
140 REM VIC STUFF
150 DATA144,5,28,159,156,30,31,158
160 DATA8,9,133,137,134,138,135,139,136,140
170 DATAHOME,CLEAR,DOWN,UP,RIGHT,LEFT,RVS,RVOFF,DEL,INST,RETURN,SPACE
180 DATABELL,D.LINE,I.LINE,ER.BEGIN,ER.END,TEXT,GRAPHIC,SCROLL.UP,SCROLL.DOWN
190 DATATOP,BOTTOM
200 DATABLACK,WHITE,RED,CYAN,MAGENTA,GREEN,BLUE,YELLOW
210 DATALOCK,UNLOCK,F1,F2,F3,F4,F5,F6,F7,F8
220 DIMA(40),A$(40),K$(90)
230 FORJ=0TO40:READA(J):NEXTJ
240 FORJ=0TO40:READA$(J):NEXTJ
250 DATAEND,FOR,NEXT,DATA,INPUT#,INPUT,DIM,READ,LET,GOTO,RUN,IF,RESTORE,GOSUB
260 DATARETURN,REM,STOP,ON,WAIT,LOAD,SAVE,VERIFY,DEF,POKE,PRINT#,PRINT,CONT
270 DATALIST,CLR,CMD,SYS,OPEN,CLOSE,GET,NEW,TAB(,TO,FN,SPC(,THEN,NOT,STEP
280 DATA+,-,*,/,^,AND,OR,>,=,<,SGN,INT,ABS,USR,FRE,POS,SQR,RND,LOG,EXP,COS
290 DATASIN,TAN,ATN,PEEK,LEN,STR$,VAL,ASC,CHR$,LEFT$,RIGHT$,MID$,GO,CONCAT
300 DATADOPEN,DCLOSE,RECORD,HEADER,COLLECT,BACKUP,COPY,APPEND,DSAVE,CATALOG
310 DATARENAME,SCRATCH,DIRECTORY
320 FORJ=0TO89:READK$(J):NEXTJ
400 CLOSE1:INPUT"NAME OF PROGRAM FILE";G$
410 OPEN1,8,3,G$+",P,R"
420 GET#1,A$,B$
430 IFA$<>CHR$(1)ANDA$<>""GOTO400
440 IFA$=""THENA$=CHR$(1):GET#1,X$
450 INPUT"LINE NUMBER RANGE -[157][157][157]";Z$
460 L0=0:L1=0:L2=1E9
470 FORJ=1TOLEN(Z$):Y$=MID$(Z$,J,1)
480 Y=ASC(Y$):IFY>=48ANDY<=57GOTO510
490 IFY=32GOTO510
500 L0=J:IFY<>45GOTO600
510 NEXTJ
520 IFL0<LEN(Z$)THENL2=VAL(MID$(Z$,L0+1)):IFL2=0THENL2=1E9
530 IFL0>1THENL1=VAL(Z$)
540 IFL0=0THENL1=L2
600 P3$="[":P4$="]":INPUT"LIST TO PRINTER N[157][157][157]";Z$
610 P=3:IFASC(Z$)=89THENP=4:L$="":P3$=CHR$(219):P4$=CHR$(221)
620 P1$="[":P2$="]":INPUT"GRAPHICS OR TEXT G[157][157][157]";Z$
630 PRINTCHR$(142):IFASC(Z$)=84THENPRINTCHR$(14):M$=L$:P1$=P3$:P2$=P4$
640 INPUT"TRANSLATE CURSOR MOVES [157][157][157]";Z$
650 IFASC(Z$)=89THENT7=1
660 OPEN4,P:F$=P1$
670 J=80:IFP<>3GOTO690
680 PRINT"[147]":PRINT"++++++++++++":FORJ=1TO81:IFPEEK(1024+J)=32THENNEXTJ
690 L9=40:PRINT#4,"PROGRAM: ";G$
700 REMNEW LINE
710 GOSUB2010:Q=0:T1=1:C1=-1:GET#1,A$,B$:IFST<>0GOTO3000
720 IFB$=""GOTO3000
730 GET#1,A$,B$
740 L=ASC(A$+CHR$(0))+ASC(B$+CHR$(0))*256
750 IFL<L1GOTO1080
760 IFL>L2GOTO3000
770 F2=1:PRINT#4,M$;P$:P$=STR$(L)+" "
800 REM START TEXT HERE
810 GET#1,A$:IFA$=""GOTO710
820 T=0:A=ASC(A$):IFA=32ANDF$=","GOTO840
830 IFQ=0OR(AAND127)>31ORT7=0GOTO900
840 FORJ=0TO40:IFA=A(J)THENB$=A$(J):GOTO860
850 NEXTJ:GOTO1000
860 IFB$=B1$THENB=B+1:GOTO810
870 IFB>0THENA$=MID$(STR$(B+1),2)+F$+B$:GOTO890
880 A$=F$+B$
890 B=0:B1$=B$:F$=",":F1=1:GOTO1010
900 A=A-128:IFA<0ORQ<>0GOTO1000
910 IFA=127THENA$="":GOTO1000
920 T=1:A$=K$(A)
930 IFA=15THENQ=2
1000 GOSUB2010
1010 IFA$=CHR$(34)THENQ=1-Q
1020 REM C=-1 FOR ALPHANUMERIC
1030 C=ASC(LEFT$(A$,1)):C=(C<48ORC>57)AND(C<65ORC>90)
1040 IFT<>T1ORT=1THENT1=T:IFNOTCANDNOTC1THENP$=P$+" ":GOSUB2500
1050 C=ASC(RIGHT$(A$,1)):C1=((C<48ORC>57)AND(C<65ORC>90))ORA=37
1060 P$=P$+A$:GOSUB2500
1070 GOTO810
1080 REM SKIP TO NEXT LINE
1090 GET#1,A$:IFA$=""GOTO710
1100 GOTO1090
2000 REM CLOSE OFF CURSOR EXPRESSION
2010 IFF1=0GOTO2040
2020 IFB>0THENP$=P$+MID$(STR$(B+1),2):GOSUB2500
2030 B=0:F1=0:B1$="":P$=P$+P2$:GOSUB2500:F$=P1$
2040 RETURN
2500 IFLEN(P$)<L9GOTO2600
2510 FORJ=L9TOL9*.6STEP-1
2520 IFMID$(P$,J,1)=":"GOTO2580
2530 NEXTJ:FORJ=L9-1TOL9*.6-1STEP-1
2540 P=ASC(MID$(P$,J))
2550 IFP=91GOTO2580
2560 IFP=59ORP=44ORP=93THENJ=J+1:GOTO2580
2570 NEXTJ:J=L9-1
2580 PRINT#4,M$;LEFT$(P$,J-1)
2590 P$=" "+MID$(P$,J)
2600 RETURN
3000 IFLEN(P$)>0THENF2=1:PRINT#4,M$;P$
3010 IFF2=0THENPRINT"** NO LINES FOUND **"
3020 CLOSE1:GOSUB2000:CLOSE4